public class Account {
  double amount;
  synchronized void transfer(Account ac, double mn){
    this.amount = this.amount - mn;
    ac.amount = ac.amount + mn; 
  }...
}